package parser.news;

/**
 * Parser for getting news from OpenNet channel
 * User: kaiser
 * Date: 8/4/13
 * Time: 2:36 AM
 * To change this template use File | Settings | File Templates.
 */
public class OpennetParser extends ChannelParser  {
    /**
     * Channel identifier name
     */
    public static final String CHANNEL_ID = "opennet";

    /**
     * News resource url
     */
    protected final String RESOURCE = "http://www.opennet.ru/opennews/opennews_6_noadv.rss";

    @Override
    protected NewsHandler getParserHandler() {
        return new NewsHandler() {

            @Override
            protected String getChannelTag() {
                return "channel";
            }

            @Override
            String getNewsTag() {
                return "item";
            }

            @Override
            String getNewsTitleTag() {
                return "title";
            }

            @Override
            String getNewsUrlTag() {
                return "link";
            }

            @Override
            String getNewsPublishDateTag() {
                return "pubDate";
            }

            @Override
            String getChannelId() {
                return CHANNEL_ID;
            }
        };
    }

    @Override
    protected String getChannelResourceLink() {
        return RESOURCE;
    }
}
